package com.whalefin.controller.advertise;


import com.whalefin.service.AdvertiseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;


/**
* Created by frank on 4/24/14.
*/
@Controller
@RequestMapping(value = "/advertise/updateStatus")
public class UpdateAdStatusController {

	@Autowired
	private AdvertiseService advertiseService;

	@RequestMapping(method = RequestMethod.GET)
	public String get(Integer id,String status) {

        if (status.equals("hide")) {
            status = "隐藏";
            advertiseService.updateStatus(id, status);
        } else if (status.equals("show")) {
            status = "显示";
            advertiseService.updateStatus(id, status);
        }
		return "redirect:/advertise/advertiseList";
	}


}
